package com.servlet.form;

import java.io.IOException;
import java.sql.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.listener.ContextListener;
import com.servlet.model.base.Profile;
import com.servlet.model.base.Status;
import com.servlet.model.database.BaseAcces;

public class ProfilForm extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
	{
		
		HttpSession session = request.getSession();
		//BaseAcces base = (BaseAcces) this.config.getServletContext().getAttribute("base");
		
		String email = (String) session.getAttribute("email");
		Profile profile = ContextListener.base.findProfile(email);
		
		String nom = profile.getLast_name();
		String prenom = profile.getFirst_name();

		
		session.setAttribute("nom", nom );
		session.setAttribute("prenom", prenom );
		response.sendRedirect("profil");
	}

}
